<template>
	<div>
		首页

		<router-link to="/detail/123">详情</router-link>
		<button @click="toDetail">去详情</button>
		<button @click="$router.push('/detail/9876543213456')">去详情</button>
	</div>
</template>


<script>
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({
	setup() {
		// 使用  hooks
		const router = useRouter()

		const toDetail = () => {
			router.push('/detail/12312312312312')
		}
		return {
			toDetail
		}
	}
})
</script>